<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Elisa3: irCommunication.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Elisa3
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('ir_communication_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">irCommunication.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="ir_communication_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 <span class="preprocessor">#ifndef IR_COMMUNICATION_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#define IR_COMMUNICATION_H</span>
<a name="l00004"></a>00004 <span class="preprocessor"></span>
<a name="l00005"></a>00005 
<a name="l00039"></a>00039 <span class="preprocessor">#include &quot;<a class="code" href="variables_8h.html">variables.h</a>&quot;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &quot;<a class="code" href="utility_8h.html" title="Utility module.">utility.h</a>&quot;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00044"></a>00044 <span class="preprocessor">#endif</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="ir_communication_8c.html#a4edd8fcaedbedf041662d600bb11b040" title="Initialize the IR communication; need to be called only once.">irCommInit</a>();
<a name="l00051"></a>00051 
<a name="l00056"></a>00056 <span class="keywordtype">void</span> <a class="code" href="ir_communication_8c.html#abca57372dec6c1f0943be58f5ba8e9a4" title="Initialize the IR communication state machine in reception mode (used internally).">irCommInitReceiver</a>();
<a name="l00057"></a>00057 
<a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="ir_communication_8c.html#a8d16ecce7eb417f3f980405b5789cbff" title="Initialize the IR communication state machine in transmission mode (used internally).">irCommInitTransmitter</a>();
<a name="l00063"></a>00063 
<a name="l00068"></a>00068 <span class="keywordtype">void</span> <a class="code" href="ir_communication_8c.html#a5fff296b971e9be5ce9f8cf3b59aeab2" title="Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled...">irCommDeinit</a>();
<a name="l00069"></a>00069 
<a name="l00074"></a>00074 <span class="keywordtype">void</span> <a class="code" href="ir_communication_8c.html#aece295aae9f5e45a418c9f7b52a09059" title="Handle the internal state machine of the IR communication. Need to be called repeatedly from the main...">irCommTasks</a>();
<a name="l00075"></a>00075 
<a name="l00077"></a>00077 <span class="comment">// * \brief Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.</span>
<a name="l00078"></a>00078 <span class="comment">// * \param value: byte to be sent; sensor: sensor id mask (bit 0 corresponds to sensor 0 in front of robot, id increases clockwise).</span>
<a name="l00079"></a>00079 <span class="comment">// * \return none</span>
<a name="l00080"></a>00080 <span class="comment">// */</span>
<a name="l00081"></a>00081 <span class="comment">//void irCommSendData(unsigned char value, unsigned char sensorMask);</span>
<a name="l00082"></a>00082 
<a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="ir_communication_8c.html#a5fb95f3139d0e550050463509be6c389" title="Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled durin...">irCommSendData</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> value);
<a name="l00089"></a>00089 
<a name="l00094"></a>00094 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="ir_communication_8c.html#a6e430d86600afbcf4b3bf0cae67225f9" title="Tell whether the last transmission is terminated or not.">irCommDataSent</a>();
<a name="l00095"></a>00095 
<a name="l00100"></a>00100 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="ir_communication_8c.html#a62232a7d4be2aeb1c2be79e532e0bef2" title="Tell whether incoming data are received or not.">irCommDataAvailable</a>();
<a name="l00101"></a>00101 
<a name="l00106"></a>00106 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="ir_communication_8c.html#ad54a767f2672a6ad24ce9442567d0e39" title="Get the last byte received through IR.">irCommReadData</a>();
<a name="l00107"></a>00107 
<a name="l00112"></a>00112 <span class="keywordtype">signed</span> <span class="keywordtype">char</span> <a class="code" href="ir_communication_8c.html#a760431ba471bb88d3614ed49a87e4e86" title="Get the last sensor id that receives the message.">irCommReceivingSensor</a>();
<a name="l00113"></a>00113 
<a name="l00118"></a>00118 <span class="keywordtype">signed</span> <span class="keywordtype">int</span> <a class="code" href="ir_communication_8c.html#a1c705dd290385be32f9032724d95eda2" title="Get the direction of the sensor that receives the last message.">getBearing</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> sensor);
<a name="l00119"></a>00119 
<a name="l00120"></a>00120 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span>} <span class="comment">// extern &quot;C&quot;</span>
<a name="l00122"></a>00122 <span class="preprocessor">#endif</span>
<a name="l00123"></a>00123 <span class="preprocessor"></span>
<a name="l00124"></a>00124 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="ir_communication_8h.html">irCommunication.h</a>      </li>

    <li class="footer">Generated on Thu Dec 4 2014 08:30:45 for Elisa3 by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
